<template>
	<view class="content">
		<view class="padding">
			<view class="flexbetween padding ffffff margin-top">
				<view class="word_hh hei">快递公司</view>
				<view class="flexleft">
					<input type="text" placeholder="请输入快递公司名称" v-model="expressName" style="text-align: right;">
					<!-- <view class="icon margin_left2"></view> -->
				</view>
			</view>
			<view class="flexbetween ffffff  padding margin-top">
				<view class="word_hh hei">快递单号</view>
			  <input type="text" placeholder="请选择快递单号" v-model="expressNo" style="text-align: right;"> 
			</view>
		</view>
		<!-- btn -->
		<view class="gudingdb">
			<view class="bigbtn" @click="submit">提交</view>
		</view>
	</view>
</template>
<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				refund_id:'',// 退货订单id
				expressName:'',// 物流公司
				expressNo:'',// 物流单号
			}
		},
		onLoad(options){
			this.refund_id=options.id
		},
		methods: {
			submit(){
				let _this=this
				if(_this.expressName==''){
					httpRequest.toast('请输入快递公司');
					return false
				}
				if(_this.expressNo==''){
					httpRequest.toast('请输入快递单号');
					return false
				}
				httpRequest.modal('提示', '确定提交单号吗？', true, (res) => {
					if (res) {
						httpRequest.request('api/order/toExpress', 'POST', {
							id: _this.refund_id,
							express_name:_this.expressName,
							express_no:_this.expressNo,
						}, false, false, true).then(res => {
							httpRequest.toast(res.msg);
							if (res.code == 1) {
								uni.navigateBack(1)
							}
						}).catch(err => {
							httpRequest.toast(err.msg);
						})
					}
				})
			}
		}
	}
</script>

<style>
.content{
	overflow: hidden;
}
</style>
